#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <vector>
#include <opencv2/opencv.hpp>
const int samplesize = 50000;
const int cubesize = 32;
int main()
{
    cv::Mat m(4,3,CV_32FC1);
    for(int i=0; i<m.rows;i++){
        for(int j=0;j<m.cols;j++){
            m.at<float>(i, j) = i*m.rows+j+0.1;
        }
    }
    cv::KDTree tree(m);
    for(int i=0;i<tree.nodes.size();i++){
        std::cout<<tree.nodes[i].boundary<<"idx: "<<tree.nodes[i].idx
                << tree.nodes[i].left << tree.nodes[i].right<<std::endl;
    }
}
